#/bin/bash

qemu_urls=(
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/aarch64/qemu-aarch64/20250616081014/openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-24.03-LTS.sh"
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/aarch64/qemu-aarch64/20250616081014/openeuler-image-qemu-aarch64-20250616081014.rootfs.cpio.gz"
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/aarch64/qemu-aarch64/20250616081014/zImage"
)

qemu6_urls=(
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/aarch64/qemu-aarch64-kernel6/20250616081014/openeuler-glibc-x86_64-openeuler-image-aarch64-qemu-aarch64-toolchain-24.03-LTS.sh"
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/aarch64/qemu-aarch64-kernel6/20250616081014/openeuler-image-qemu-aarch64-20250616081014.rootfs.cpio.gz"
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/aarch64/qemu-aarch64-kernel6/20250616081014/zImage"
)

x86_urls=(
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/x86-64/x86-64/20250615081014/openeuler-glibc-x86_64-openeuler-image-x86_64-generic-x86-64-toolchain-24.03-LTS.sh"
"http://121.36.84.172/dailybuild/EBS-openEuler-24.03-LTS/embedded_img/x86-64/x86-64/20250615081014/openeuler-image-generic-x86-64-20250615081014.rootfs.cpio.gz"
)


mkdir -p "2403ltssp2"
cd "2403ltssp2"

for url in "${qemu_urls[@]}"
do
    mkdir -p "qemu"
    pushd "qemu"
    wget  --no-check-certificate "$url"
    popd
done

for url in "${qemu6_urls[@]}"
do
    mkdir -p "qemu_kernel6"
    pushd "qemu_kernel6"
    wget  --no-check-certificate "$url"
    popd
done

for url in "${x86_urls[@]}"
do
    mkdir -p "x86_64"
    pushd "x86_64"
    wget  --no-check-certificate "$url"
    popd
done